import { Redirect } from 'umi'
import { getToken } from '@/utils/auth'

export default props => {
  const isLogin = getToken()
  if (isLogin) {
    return <div>{props.children}</div>
  } else {
    return <Redirect to="/login" />
  }
}
